package com.qys.livesMall.user.controller.sys;

import com.qys.livesMall.common.result.R;
import com.qys.livesMall.system.source.domain.entity.SysMenu;
import com.qys.livesMall.user.service.ISysRoleMenuService;
import com.qys.livesMall.framework.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 用户系统菜单
 *
 * @date 2023/05/22 18:46
 */
@RestController
@RequestMapping("/system/user/menu")
public class SysUserMenuController {

    /**
     * 用户菜单
     */
    @Autowired
    private ISysRoleMenuService iSysRoleMenuService;

    @GetMapping("/list")
    public R<List<SysMenu>> list() {
        List<SysMenu> menus = iSysRoleMenuService.selectMenuList(SecurityUtils.getUserId());
        return R.ok(menus);
    }

}

